from selenium import webdriver
from selenium.webdriver import ActionChains
import time


def rest(sec):
    time.sleep(sec)

if __name__ == '__main__':
    browser = webdriver.Chrome()
    url = 'https://html5demos.com/drag/'

    browser.get(url)
    draggable = browser.find_element_by_xpath('//*[@id="two"]')
    target = browser.find_element_by_xpath('//*[@id="bin"]')
    print(draggable.text)
    # 新建 actions
    actions = ActionChains(browser)
    actions.drag_and_drop(draggable, target)
    actions.perform()
